package com.ourteam.product.model.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Tue Nov 07 10:29:34 IRKT 2017
 * Auto Generate Date : 2017-11-15 14:52:11
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class ProductModelObjectRelateBean implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id",
            com.ourteam.product.model.dao.IProductModelObjectRelateDAO.Id);

        mappedDaoFields.put("relateCode",
            com.ourteam.product.model.dao.IProductModelObjectRelateDAO.RelateCode);

        mappedDaoFields.put("relateName",
            com.ourteam.product.model.dao.IProductModelObjectRelateDAO.RelateName);

        mappedDaoFields.put("objectId",
            com.ourteam.product.model.dao.IProductModelObjectRelateDAO.ObjectId);

        mappedDaoFields.put("relatedObjectId",
            com.ourteam.product.model.dao.IProductModelObjectRelateDAO.RelatedObjectId);

        mappedDaoFields.put("relatedType",
            com.ourteam.product.model.dao.IProductModelObjectRelateDAO.RelatedType);

        mappedDaoFields.put("relatedConfig",
            com.ourteam.product.model.dao.IProductModelObjectRelateDAO.RelatedConfig);

        mappedDaoFields.put("sortIndex",
            com.ourteam.product.model.dao.IProductModelObjectRelateDAO.SortIndex);

        mappedDaoFields.put("status",
            com.ourteam.product.model.dao.IProductModelObjectRelateDAO.Status);

        mappedDaoFields.put("remarks",
            com.ourteam.product.model.dao.IProductModelObjectRelateDAO.Remarks);

        mappedDaoFields.put("relatedObjectName",
            com.ourteam.product.model.dao.IProductModelObjectRelateDAO.RelatedObjectName);

        mappedDaoFields.put("relatedObjectType",
            com.ourteam.product.model.dao.IProductModelObjectRelateDAO.RelatedObjectType);

        mappedDaoFields.put("relatedObjectPackageId",
            com.ourteam.product.model.dao.IProductModelObjectRelateDAO.RelatedObjectPackageId);

        mappedDaoFields.put("relatedObjectPackageName",
            com.ourteam.product.model.dao.IProductModelObjectRelateDAO.RelatedObjectPackageName);

        mappedDaoFields.put("relatedObjectRemarks",
            com.ourteam.product.model.dao.IProductModelObjectRelateDAO.RelatedObjectRemarks);

        mappedDaoFields.put("objectName",
            com.ourteam.product.model.dao.IProductModelObjectRelateDAO.ObjectName);

        mappedDaoFields.put("objectType",
            com.ourteam.product.model.dao.IProductModelObjectRelateDAO.ObjectType);

        mappedDaoFields.put("objectPackageId",
            com.ourteam.product.model.dao.IProductModelObjectRelateDAO.ObjectPackageId);

        mappedDaoFields.put("objectPackageName",
            com.ourteam.product.model.dao.IProductModelObjectRelateDAO.ObjectPackageName);

        mappedDaoFields.put("objectRemarks",
            com.ourteam.product.model.dao.IProductModelObjectRelateDAO.ObjectRemarks);
    }

    private com.ourteam.product.model.dao.ProductModelObjectRelate productModelObjectRelate;

    public ProductModelObjectRelateBean() {
        super();

        this.productModelObjectRelate = new com.ourteam.product.model.dao.ProductModelObjectRelate();
    }

    public ProductModelObjectRelateBean(
        com.ourteam.product.model.dao.ProductModelObjectRelate productModelObjectRelate) {
        super();

        this.productModelObjectRelate = productModelObjectRelate;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(productModelObjectRelate);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.product.model.dao.ProductModelObjectRelate convertToProductModelObjectRelate() {
        return this.productModelObjectRelate;
    }

    public com.ourteam.product.model.dao.ProductModelObjectRelate convertTo() {
        return this.productModelObjectRelate;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.productModelObjectRelate.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.productModelObjectRelate.setId(id);
    }

    /**
     * Get relateCode
     *
     * @return String
     */
    public String getRelateCode() {
        return (String) this.productModelObjectRelate.getRelateCode();
    }

    /**
     * Set relateCode
     *
     * @parameter String
     */
    public void setRelateCode(String relateCode) {
        this.productModelObjectRelate.setRelateCode(relateCode);
    }

    /**
     * Get relateName
     *
     * @return String
     */
    public String getRelateName() {
        return (String) this.productModelObjectRelate.getRelateName();
    }

    /**
     * Set relateName
     *
     * @parameter String
     */
    public void setRelateName(String relateName) {
        this.productModelObjectRelate.setRelateName(relateName);
    }

    /**
     * Get objectId
     *
     * @return long
     */
    public long getObjectId() {
        return (long) this.productModelObjectRelate.getObjectId();
    }

    /**
     * Set objectId
     *
     * @parameter long
     */
    public void setObjectId(long objectId) {
        this.productModelObjectRelate.setObjectId(objectId);
    }

    /**
     * Get relatedObjectId
     *
     * @return long
     */
    public long getRelatedObjectId() {
        return (long) this.productModelObjectRelate.getRelatedObjectId();
    }

    /**
     * Set relatedObjectId
     *
     * @parameter long
     */
    public void setRelatedObjectId(long relatedObjectId) {
        this.productModelObjectRelate.setRelatedObjectId(relatedObjectId);
    }

    /**
     * Get relatedType
     *
     * @return String
     */
    public String getRelatedType() {
        return (String) this.productModelObjectRelate.getRelatedType();
    }

    /**
     * Set relatedType
     *
     * @parameter String
     */
    public void setRelatedType(String relatedType) {
        this.productModelObjectRelate.setRelatedType(relatedType);
    }

    /**
     * Get relatedConfig
     *
     * @return String
     */
    public String getRelatedConfig() {
        return (String) this.productModelObjectRelate.getRelatedConfig();
    }

    /**
     * Set relatedConfig
     *
     * @parameter String
     */
    public void setRelatedConfig(String relatedConfig) {
        this.productModelObjectRelate.setRelatedConfig(relatedConfig);
    }

    /**
     * Get sortIndex
     *
     * @return int
     */
    public int getSortIndex() {
        return (int) this.productModelObjectRelate.getSortIndex();
    }

    /**
     * Set sortIndex
     *
     * @parameter int
     */
    public void setSortIndex(int sortIndex) {
        this.productModelObjectRelate.setSortIndex(sortIndex);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.productModelObjectRelate.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.productModelObjectRelate.setStatus(status);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.productModelObjectRelate.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.productModelObjectRelate.setRemarks(remarks);
    }

    /**
     * Get relatedObjectName
     *
     * @return String
     */
    public String getRelatedObjectName() {
        return (String) this.productModelObjectRelate.getRelatedObjectName();
    }

    /**
     * Get relatedObjectType
     *
     * @return String
     */
    public String getRelatedObjectType() {
        return (String) this.productModelObjectRelate.getRelatedObjectType();
    }

    /**
     * Get relatedObjectPackageId
     *
     * @return long
     */
    public long getRelatedObjectPackageId() {
        return (long) this.productModelObjectRelate.getRelatedObjectPackageId();
    }

    /**
     * Get relatedObjectPackageName
     *
     * @return String
     */
    public String getRelatedObjectPackageName() {
        return (String) this.productModelObjectRelate.getRelatedObjectPackageName();
    }

    /**
     * Get relatedObjectRemarks
     *
     * @return String
     */
    public String getRelatedObjectRemarks() {
        return (String) this.productModelObjectRelate.getRelatedObjectRemarks();
    }

    /**
     * Get objectName
     *
     * @return String
     */
    public String getObjectName() {
        return (String) this.productModelObjectRelate.getObjectName();
    }

    /**
     * Get objectType
     *
     * @return String
     */
    public String getObjectType() {
        return (String) this.productModelObjectRelate.getObjectType();
    }

    /**
     * Get objectPackageId
     *
     * @return long
     */
    public long getObjectPackageId() {
        return (long) this.productModelObjectRelate.getObjectPackageId();
    }

    /**
     * Get objectPackageName
     *
     * @return String
     */
    public String getObjectPackageName() {
        return (String) this.productModelObjectRelate.getObjectPackageName();
    }

    /**
     * Get objectRemarks
     *
     * @return String
     */
    public String getObjectRemarks() {
        return (String) this.productModelObjectRelate.getObjectRemarks();
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof ProductModelObjectRelateBean) == false) {
            return false;
        } // end if

        ProductModelObjectRelateBean other = (ProductModelObjectRelateBean) obj;

        boolean isEqual = false;

        com.ourteam.product.model.dao.ProductModelObjectRelate tempProductModelObjectRelate =
            other.convertToProductModelObjectRelate();

        if ((tempProductModelObjectRelate == null) ||
                (this.productModelObjectRelate == null)) {
            isEqual = false;
        } else if ((tempProductModelObjectRelate == this.productModelObjectRelate) ||
                tempProductModelObjectRelate.equals(
                    this.productModelObjectRelate)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static ProductModelObjectRelateBean[] toArray(
        com.ourteam.product.model.dao.ProductModelObjectRelate[] aProductModelObjectRelates) {
        return toArray(aProductModelObjectRelates, null);
    }

    public static ProductModelObjectRelateBean[] toArray(
        com.ourteam.product.model.dao.ProductModelObjectRelate[] aProductModelObjectRelates,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aProductModelObjectRelates)) {
            return new ProductModelObjectRelateBean[0];
        }

        int length = aProductModelObjectRelates.length;

        ProductModelObjectRelateBean[] beans = new ProductModelObjectRelateBean[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new ProductModelObjectRelateBean(aProductModelObjectRelates[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i],
                    new Object[] { aProductModelObjectRelates[i] });
            }
        }

        return beans;
    }
}
